package com.huashi.dealer.modular.business.order.param;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.huashi.dealer.core.util.TimeUtil;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 订单发货明细响应参数
 *
 * @author 谭陈强
 * @since 2025-07-30
 */
@Data
@Schema(description = "订单发货明细响应参数")
public class OrderExpressResponseParam {
    
    @Schema(description = "订单物流ID")
    private Integer orderExpressId;
    
    @Schema(description = "订单ID")
    private Integer orderId;
    
    @Schema(description = "物流公司")
    private String expressCompany;
    
    @Schema(description = "物流单号")
    private String expressNo;
    
    @Schema(description = "发货时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime deliveryTime;
    
    @Schema(description = "物流图片")
    private Object images;
    
    @Schema(description = "物流图片列表")
    private List<String> imagesValue;
    
    @Schema(description = "商品数量")
    private Object goodsNum;
    
    @Schema(description = "已发货数量")
    private Integer goodsCheckNum;
    
    @Schema(description = "商品信息")
    private List<OrderGoodsVo> goods;
    
    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    public void setUpdateTime(Long updateTime) {
        this.updateTime = TimeUtil.changeToLocalDateTime(updateTime);
    }

    public void setCreateTime(Long createTime) {
        this.createTime = TimeUtil.changeToLocalDateTime(createTime);
    }

    public void setDeliveryTime(Long deliveryTime) {
        this.deliveryTime = TimeUtil.changeToLocalDateTime(deliveryTime);
    }

    @Schema(description = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
    
    @Schema(description = "物流动态信息")
    private Object expressDynamic;
    
    /**
     * 订单商品VO
     */
    @Data
    @Schema(description = "订单商品VO")
    public static class OrderGoodsVo {
        
        @Schema(description = "订单商品ID")
        private Integer orderGoodsId;
        
        @Schema(description = "商品ID")
        private Integer goodsId;
        
        @Schema(description = "商品名称")
        private String goodsName;
        
        @Schema(description = "商品图片")
        private String goodsImage;
        
        @Schema(description = "商品规格")
        private String goodsSpec;
        
        @Schema(description = "商品数量")
        private Integer totalNum;
        
        @Schema(description = "商品单价")
        private String goodsPrice;
        
        @Schema(description = "商品总价")
        private String totalPrice;
    }
} 